{if $params.action=="index"}
	
	{if $Acl.mvc.control.forms.add}
		<p><a href="{$view->siteUrl()}/control/forms/add/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-plusthick"></span><span class="ui-button-text">{_('Добавить')} {_('форму')}</span></a></p>
	{/if}

	{$ResourceDataTable}

{/if}


{if $params.action=="add" || $params.action=="edit"}
	{$Form}
{/if}


{if $params.action=="entries"}

	<p><a href="{$view->siteUrl()}/control/forms/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-document"></span><span class="ui-button-text">{_('Список')} {_('форм')}</span></a></p>

	{$EntriesDataTable}

{/if}


{if $params.action=="view"}

	{if $Acl.mvc.control.forms.entries}
		<p><a href="{$view->siteUrl()}/control/forms/entries/resourceid/{$EntryInfo.resourceid}/" class="ui-button ui-button-text-icons ui-state-default ui-corner-all"><span class="ui-icon ui-icon-document"></span><span class="ui-button-text">{_('Список')} {_('записей')}</span></a></p>
	{/if}

	<form method="POST" enctype="multipart/form-data">
		
		<dl class="zend_form">
			
			<fieldset class="ui-widget-content ui-corner-all">
				<legend>{_('Поля формы')}</legend>
				<table>
					{foreach from=$EntryInfo.fields item=data}
						{if $data.fieldtype!="Captcha"}
							<tr>
								<td><b>{$data.fieldname}</b></td>
								<td>
									{if $EntryInfo.entrydata[$data.fieldid]|is_array}
										{", "|implode:$EntryInfo.entrydata[$data.fieldid]}
									{else}
										{if $data.fieldtype=="File"}
											<a href="{$view->baseUrl()}/upload_forms/{$EntryInfo.entryid}_field_{$data.fieldid}.{preg_replace("#^.*?\.([0-9a-z]{ldelim}2,4{rdelim})$#","$1",$EntryInfo.entrydata[$data.fieldid])}" target="_blank">{$EntryInfo.entrydata[$data.fieldid]}</a>
										{elseif $data.fieldtype=="Refferer"}
											<a href="{$EntryInfo.entrydata[$data.fieldid]}" target="_blank">{$EntryInfo.entrydata[$data.fieldid]}</a>
										{else}
											{$EntryInfo.entrydata[$data.fieldid]}
										{/if}
									{/if}
								</td>
							</tr>
						{/if}
					{/foreach}
				</table>
			</fieldset>
			
			</dl>
		
			<dl class="right zend_form">
		
			<fieldset class="ui-widget-content ui-corner-all">
				<legend>{_('Общие данные')}</legend>
				<table>
					<tr>
						<td><b>{_('Дата записи')}</b></td>
						<td>{$EntryInfo.entrydate|date_format:"%d.%m.%Y %H:%M"}</td>
					</tr>
					<tr>
						<td><b>{_('Пользователь')}</b></td>
						<td>{$EntryInfo.username}</td>
					</tr>
					<tr>
						<td><b>{_('IP-адрес пользователя')}</b></td>
						<td>{$EntryInfo.userip|long2ip}</td>
					</tr>
				</table>
			</fieldset>
			
		</dl>
			
	</form>

{/if}

